﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class home_loan_Home_Loan : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string _strMaintenance = CE.Configuration.MyConfigurationManager.GetAppSettingValue("IsMaintenance");
        if (_strMaintenance == "1")
        {
            Response.Redirect("~/maintenance.aspx");
        }
        string _strCXLive = CE.Configuration.MyConfigurationManager.GetAppSettingValue("IsCXLive");
        string _IsHFLive = CE.Configuration.MyConfigurationManager.GetAppSettingValue("IsHFLive");
        if ((_strCXLive == "0" || _strCXLive == "1") && _IsHFLive == "0")
        {
            if (_strCXLive == "0" && Session[CE.Global.General.Guest] == null)
            {
                Response.Redirect("~/default.aspx");
            }
            else if (_strCXLive == "1" && _IsHFLive == "0")
            {
                if (Session[CE.Global.General.Guest] == null)
                {
                    Response.Redirect("~/home-loan/comingsoon.aspx");
                }
            }
            else if (Session[CE.Global.General.Guest].ToString() == "Provider")
            {
                if (Session[CE.Global.General.UserId] == null)
                {
                    Response.Redirect("~/Provider/ProviderSecureLogin.aspx");
                }
            }
        }

        if (Session[CE.Global.General.UserId] != null && Session[CE.Global.General.HLId] != null)
        {
            if (Session[CE.Global.General.UserId] != null)
            {
                CE.Global.General.CreateUpdateUserLoginCached(Page);
            }

            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "JS_AjaxSessionTimer", "../includes/AjaxSessionTimer.js");
            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "JS_Net", "../includes/net.js");
        }
    }
}
